<template>
	<view class="userPopupShow" v-if="userPopupShow">
		<view class="userPopupShow-mask" @click="closeUserPopup"></view>
		<view class="userPopupShow-c">
			<view class="userPopupShow-close" @click="closeUserPopup">
				<u-icon name="close" color="#909399" size="20"></u-icon>
			</view>
			<scroll-view class="userPopupShow-c-list" scroll-y="true" >
				<!-- <view class="userPopupShow-c-list-item">
					<image :src="it.logo" mode="aspectFill"></image>
					<view class="userPopupShow-c-list-item-r">
						<view class="userPopupShow-c-list-item-name">{{it.name || ''}}</view>
					</view>
				</view> -->
				<view class="form-list-files">
					<view class="form-list-files-item" v-for="(item,index) in list" @click="setUserCurrent(item)">
						<view class="form-list-files-item-img">
							<image :src="item.url + '?ci-process=doc-preview&page=1&width=100'" mode=""></image>
							<!-- <uni-icons custom-prefix="iconfont" type="icon-file_pdf" size="50" color="#e4393c"></uni-icons> -->
						</view>
						<view class="form-list-files-item-c">
							<view class="form-list-files-item-c-t">
								<view class="form-list-files-item-c-title ellipsis">{{item.name || ''}}</view>
								<view class="form-list-files-item-c-project">（共享项目）</view>
							</view>
							<view class="form-list-files-item-c-time">{{item.create_time || ''}}</view>
						</view>
					</view>
				</view>
				<u-loadmore :status="status" />
			</scroll-view>
			
		</view>
	</view>
</template>

<script>
	import {
		InformationLianchuangList,
		InformationLianchuangData,
		goodsDeliveryOrder,
		goodsGoodsForSale,
		goodsCarryingData,
		user_circle
	} from '@/common/http/api.js'
	export default {
		data(){
			return {
				userPopupShow: false,
				params:{
					page: 1,
					type: 1
				},
				list: [],
				isList: true,
				status: 'loading'
			}
		},
		methods:{
			closeUserPopup(){
				this.userPopupShow = false
			},
			scrolltolower(){
				console.log('触底了')
				if(this.isList) {
					this.params.page ++
					this.init()
				}
			},
			reload(){
				this.params.page = 1
				this.isList = true
				this.init()
			},
			init(){
				this.status = 'loading'
				user_circle(this.params).then(res=>{
					this.list = res.data
					this.status = 'nomore'
				})
			},
			show(list){
				this.userPopupShow = true
				this.list = list
				this.status = 'nomore'
			},
			setUserCurrent(it){
				this.$emit('change',it)
				this.closeUserPopup()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.userPopupShow {
		width: 100vw;
		height: 100vh;
		position: fixed;
		top: 0;
		right: 0;
		z-index: 999999;
		.userPopupShow-mask {
			width: 100%;
			height: 100%;
			background: rgba(0,0,0,0.2);
		}
		.userPopupShow-c {
			width: 600rpx;
			height: fit-content;
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			margin: auto;
			z-index: 2;
			background: white;
			border-radius: 30rpx;
			box-shadow: 0 0 12rpx #e4e4e4;
			.userPopupShow-close {
				display: flex;
				justify-content: flex-end;
				box-sizing: border-box;
				padding-right: 20rpx;
				padding-top: 20rpx;
			}
			.userPopupShow-c-list {
				width: 100%;
				padding: 20rpx;
				height: 620rpx;
				overflow-y: scroll;
				box-sizing: border-box;
				
			}
		}
		
	}
	.userPopupShow-c-list-item {
		width: 100%;
		display: flex;
		align-items: center;
		background: #F7F7F7;
		box-sizing: border-box;
		padding: 10rpx 20rpx;
		margin-bottom: 20rpx;
		border-radius: 10rpx;
		
		image {
			width: 100rpx;
			height: 100rpx;
			border-radius: 10rpx;
			margin-right: 20rpx;
		}
		.userPopupShow-c-list-item-r {
			flex: 1;
			min-width: 0;
			display: flex;
			height: 100rpx;
			justify-content: flex-start;
			align-items: center;
			flex-direction: unset!important;
			.userPopupShow-c-list-item-name {
				font-size: 28rpx;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}
			.userPopupShow-c-list-item-num {
				color: #e4393c;
				font-size: 28rpx;
				font-weight: bold;
			}
		}
		
	}
	.spec-people {
		background: white;
		box-sizing: border-box;
		padding: 20rpx 33rpx 20rpx 30rpx;
		border-bottom: 10rpx solid #f5f5f5;
		align-items: center;
		.spec-address-r {
			width: 40rpx;
			display: flex;
			align-items: center;
			
			image {
				width: 40rpx;
				margin-right: 0;
			}
		}
	}
	.form-list-files {
		width: 100%;
	
		.form-list-files-item {
			width: 100%;
			display: flex;
			align-items: center;
			margin-bottom: 20rpx;
	
			.form-list-files-item-img {
				width: 100rpx;
				height: 100rpx;
				border-radius: 20rpx;
				image {
					width: 100%;
					height: 100%;
				}
			}
	
			.form-list-files-item-c {
				flex: 1;
				min-width: 0;
				display: flex;
				justify-content: space-between;
				flex-direction: column;
				height: 100rpx;
				margin: 0 20rpx;
	
				.form-list-files-item-c-t {
					width: 100%;
					display: flex;
					align-items: center;
	
					.form-list-files-item-c-title {
						flex: 1;
						min-width: 0;
						width: fit-content;
						font-size: 28rpx;
						color: #333;
						font-weight: bold;
					}
	
					.form-list-files-item-c-project {
						font-size: 32rpx;
						color: #23B97F;
						width: 96rpx * 2;
						font-weight: bold;
					}
				}
	
				.form-list-files-item-c-time {
					font-size: 26rpx;
					color: #555;
				}
			}
	
			.form-list-files-item-r {
				height: 100rpx;
				width: 50rpx;
	
			}
		}
	
		.form-list-files-item:last-child {
			margin-bottom: 0;
		}
	
		.form-list-files-item:first-child {
			padding-top: 20rpx;
		}
	}
</style>